HELP - Parse Error

HELP - Parse Error

am 04.08.2009 19:47:40 von Allen McCabe

--0016368324ea9ec7ab0470547b7c
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

*Parse error*: syntax error, unexpected $end in *
/home/a9066165/public_html/admin/processccu.php* on line *231*

I did some major code rewriting about halfway through (lines 114-132), and
suddenly I'm getting the above ERROR. I have examined the code line by line,
but I'm still relatively new to this, and I don't even know what to look
for!

Here is the complete code, from beginning tag:



//CHECKS TO SEE IF FIELDS WERE PROPERLY COMPLETED AND ASSIGNS VARIABLES TO
INPUTS - OTHERWISE AN ERROR MESSAGE IS PRINTED
$Employee = $_POST['Employee'];
if(!empty($_POST['FirstName'])) {
$FirstName = $_POST['FirstName'];
} else {
print "

You have not entered the customer's First
Name
, please go back and enter it now.

";
}

if(!empty($_POST['LastName'])) {
$LastName = $_POST['LastName'];
} else {
print "

You have not entered the customer's Last
Name
, please go back and enter it now.

";
}
if(!empty($_POST['EMailAddress'])) {
$EMailAddress = $_POST['EMailAddress'];
} else {
$EMailAddress = " ";
if(!empty($_POST['Address1'])) {
$Address1 = $_POST['Address1'];
} else {
print "

You must supply the customer's First Address
Line
, please go back and enter it now.

";
}
if(!empty($_POST['Address2'])) {
$Address2 = $_POST['Address2'];
} else {
$Address2 = " ";
}
if(!empty($_POST['City'])) {
$City = $_POST['City'];
} else {
print "

You have not entered the customer's City,
please go back and enter it now.

";
}
if(!empty($_POST['IsHandicappedAccommodations'])) {
$IsHandicappedAccommodations = "YES";
} else {
$IsHandicappedAccommodations = "NO";
}
if(!empty($_POST['State'])) {
$State = $_POST['State'];
} else {
print "

You have not entered the customer's State,
please go back and enter it now.

";
}
if(!empty($_POST['ZIP'])) {
$ZIP = $_POST['ZIP'];
} else {
print "

You have not entered the customer's ZIP
Code
, please go back and enter it now.

";
}
if(!empty($_POST['IsSenior'])) {
$IsSenior = "YES";
} else {
$IsSenior = "NO";
}
if(!empty($_POST['DaytimeTelephone'])) {
$DaytimeTelephone = $_POST['DaytimeTelephone'];
} else {
print "

You have not entered the customer's Daytime
Telephone Number
, please go back and enter it now.

";
}

$_POST['Category1'] = $Category1;
$_POST['Category2'] = $Category2;
$_POST['Category3'] = $Category3;
$_POST['Category4'] = $Category4;
$_POST['Category5'] = $Category5;
$_POST['Category6'] = $Category6;
$select = "Select";

if($Category1 == $select && $Category2 == $select && $Category3 == $select
&& $Category4 == $select && $Category5 == $select && $Category6 == $select)
{
print "

You must choose at least one Category!

";
}

$categoryarray = array($Category1, $Category2, $Category3, $Category4,
$Category5, $Category6);
foreach ($categoryarray as $c) {
if ($c == $select) {
$c = " ";
}
}

//REPLACES NAME VALUES WITH USER-FRIENDLY STRINGS
$fields = array();
$fields{"EMailAddress"} = "Email Address";
$fields{"FirstName"} = "First Name";
$fields{"LastName"} = "Last Name";
$fields{"DaytimeTelephone"} = "Home Phone";
$fields{"Address1"} = "Address Line 1";
$fields{"Address2"} = "Address Line 2";
$fields{"City"} = "City";
$fields{"State"} = "State";
$fields{"ZIP"} = "Postal Code";
$fields2 = array();
$fields2{"Employee"} = "Employee";
$fields2{"IsHandicappedAccommodations"} = "Needs Handicap Accommodations";
$fields2{"IsSenior"} = "Senior Status";
$fields2{"Category1"} = "Email Category 1";
$fields2{"Category2"} = "Email Category 2";
$fields2{"Category3"} = "Email Category 3";
$fields2{"Category4"} = "Email Category 4";
$fields2{"Category5"} = "Email Category 5";
$fields2{"Category6"} = "Email Category 6";
//SETS VARIABLES TO BE USED FOR EMAIL
$to = "marketing@cityoflancasterca.org";
$subject = "Constant Contact Update Form";
$headers = "From: $Employee\nMIME-Version: 1.0\nContent-type:
text/html\ncharset: iso-8859-1";
$body = "We have received the following
information:\n\n\n\n border='1'>\n\n";
//FOREACH LOOP
$format = "%s\t";
$headerlabel = '0';
foreach ($fields as $x => $y) {
$headerlabel = $headerlabel +1;
$body .= "\n";
}

$body .= "\n\n";
foreach ($fields2 as $x => $y) {
$body .= "\n";
}
$body .= "\n\n";
foreach ($categoryarray as $d) {
$body .= "\n";
}

$body .= "\n\n\n\n
{$headerlabel}
\n height='1'>
{$y}
{$d}
\n";

foreach ($fields as $a => $b) {
$body .= sprintf($format, $b);
}
$body .= "
";

foreach ($fields as $a => $b) {
$body .= sprintf($format, $_POST[$a]);
}
$body .= "
\n\n";
//END FOREACH LOOPS

//SETS VARIABLES TO BE USED FOR THANK-YOU EMAIL

$send = mail($to, $subject, $body, $headers);

//test escape character on URL
if($send) {header("Location: http:/\/
lpacmarketing.hostzi.com/admin/processccu.php");
} else {
print "

We encountered an error submitting your survey!
Please notify marketing@cityoflancasterca.org.
>";
}
?>


















--0016368324ea9ec7ab0470547b7c--

Re: HELP - Parse Error

am 04.08.2009 19:51:44 von parasane

On Tue, Aug 4, 2009 at 13:47, Allen McCabe wrote:
[snip="everything"]

Looks like you're missing a closing bracket here:

if(!empty($_POST['EMailAddress'])) {
$EMailAddress = $_POST['EMailAddress'];
} else {
$EMailAddress = " ";
// <--- Right here

--

daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: HELP - Parse Error

am 04.08.2009 19:56:53 von List Manager

Allen McCabe wrote:
> *Parse error*: syntax error, unexpected $end in *
> /home/a9066165/public_html/admin/processccu.php* on line *231*
>

I have learned from a number of similar mistakes that this error message
/normally/ means that I have a miss-matched number of brackets on a
foreach, while, or if, etc... statement.

Usually the line number will represent the last line in your script. In
this case, they don't seem to match...

Jim

> I did some major code rewriting about halfway through (lines 114-132), and
> suddenly I'm getting the above ERROR. I have examined the code line by line,
> but I'm still relatively new to this, and I don't even know what to look
> for!
>
> Here is the complete code, from beginning tag:
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: HELP - Parse Error

am 04.08.2009 19:58:18 von Ashley Sheridan

On Tue, 2009-08-04 at 10:56 -0700, Jim Lucas wrote:
> Allen McCabe wrote:
> > *Parse error*: syntax error, unexpected $end in *
> > /home/a9066165/public_html/admin/processccu.php* on line *231*
> >
>
> I have learned from a number of similar mistakes that this error message
> /normally/ means that I have a miss-matched number of brackets on a
> foreach, while, or if, etc... statement.
>
> Usually the line number will represent the last line in your script. In
> this case, they don't seem to match...
>
> Jim
>
> > I did some major code rewriting about halfway through (lines 114-132), and
> > suddenly I'm getting the above ERROR. I have examined the code line by line,
> > but I'm still relatively new to this, and I don't even know what to look
> > for!
> >
> > Here is the complete code, from beginning tag:
> >
>
>
>
Thats why I always prefer to have the brackets line up in the code (I
forget what the style is called) so that it looks like this:

function someFunction
{
if(condition)
{
do something
}
}

etc..

Thanks,
Ash
http://www.ashleysheridan.co.uk


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: HELP - Parse Error

am 04.08.2009 20:09:25 von Allen McCabe

--0016364ee4a86fec04047054c919
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Ashley - I am formatting this way, it just didn't translate into gmail : )

Daniel, Martin, and Jim - Thanks very much, my php runs now, however I don't
get the result page anymore. My inbox receives the form (missing cells, but
that's another issue), but the browser doesn't load processccu.php, it says
it cannot display the webpage.

note: I did address the mismatch of the DIV and TABLE (including TR's, TD's)
tags, so I don't think it's my HTML.

On Tue, Aug 4, 2009 at 10:58 AM, Ashley Sheridan
wrote:

> On Tue, 2009-08-04 at 10:56 -0700, Jim Lucas wrote:
> > Allen McCabe wrote:
> > > *Parse error*: syntax error, unexpected $end in *
> > > /home/a9066165/public_html/admin/processccu.php* on line *231*
> > >
> >
> > I have learned from a number of similar mistakes that this error message
> > /normally/ means that I have a miss-matched number of brackets on a
> > foreach, while, or if, etc... statement.
> >
> > Usually the line number will represent the last line in your script. In
> > this case, they don't seem to match...
> >
> > Jim
> >
> > > I did some major code rewriting about halfway through (lines 114-132),
> and
> > > suddenly I'm getting the above ERROR. I have examined the code line by
> line,
> > > but I'm still relatively new to this, and I don't even know what to
> look
> > > for!
> > >
> > > Here is the complete code, from beginning
> tag:
> > >
> >
> >
> >
> Thats why I always prefer to have the brackets line up in the code (I
> forget what the style is called) so that it looks like this:
>
> function someFunction
> {
> if(condition)
> {
> do something
> }
> }
>
> etc..
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>

--0016364ee4a86fec04047054c919--

Re: HELP - Parse Error

am 04.08.2009 20:28:39 von Allen McCabe

--0016364ef4d63652d50470550e98
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Well, I got it to display a thank you page instead of what I had. I'm
rolling with the punches. Got to work on why my email table is not building
right. Stay tuned!

On Tue, Aug 4, 2009 at 11:09 AM, Allen McCabe wrote:

> Ashley - I am formatting this way, it just didn't translate into gmail : )
>
> Daniel, Martin, and Jim - Thanks very much, my php runs now, however I
> don't get the result page anymore. My inbox receives the form (missing
> cells, but that's another issue), but the browser doesn't load
> processccu.php, it says it cannot display the webpage.
>
> note: I did address the mismatch of the DIV and TABLE (including TR's,
> TD's) tags, so I don't think it's my HTML.
>
> On Tue, Aug 4, 2009 at 10:58 AM, Ashley Sheridan <
> ash@ashleysheridan.co.uk> wrote:
>
>> On Tue, 2009-08-04 at 10:56 -0700, Jim Lucas wrote:
>> > Allen McCabe wrote:
>> > > *Parse error*: syntax error, unexpected $end in *
>> > > /home/a9066165/public_html/admin/processccu.php* on line *231*
>> > >
>> >
>> > I have learned from a number of similar mistakes that this error message
>> > /normally/ means that I have a miss-matched number of brackets on a
>> > foreach, while, or if, etc... statement.
>> >
>> > Usually the line number will represent the last line in your script. In
>> > this case, they don't seem to match...
>> >
>> > Jim
>> >
>> > > I did some major code rewriting about halfway through (lines 114-132),
>> and
>> > > suddenly I'm getting the above ERROR. I have examined the code line by
>> line,
>> > > but I'm still relatively new to this, and I don't even know what to
>> look
>> > > for!
>> > >
>> > > Here is the complete code, from beginning
>> tag:
>> > >
>> >
>> >
>> >
>> Thats why I always prefer to have the brackets line up in the code (I
>> forget what the style is called) so that it looks like this:
>>
>> function someFunction
>> {
>> if(condition)
>> {
>> do something
>> }
>> }
>>
>> etc..
>>
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>>
>>
>

--0016364ef4d63652d50470550e98--

Re: HELP - Parse Error

am 04.08.2009 20:28:41 von List Manager

Allen McCabe wrote:
> Ashley - I am formatting this way, it just didn't translate into gmail : )

You might try using indentation with more then one space. Try tabs.
Any respectable editor will allow you to set the number of spaces it
uses to actually represent the tab.

That way I can have mine set to 8 spaces while other can have 3 or 4 spaces.

>
> Daniel, Martin, and Jim - Thanks very much, my php runs now, however I don't
> get the result page anymore. My inbox receives the form (missing cells, but
> that's another issue), but the browser doesn't load processccu.php, it says
> it cannot display the webpage.
>
> note: I did address the mismatch of the DIV and TABLE (including TR's, TD's)
> tags, so I don't think it's my HTML.
>
> On Tue, Aug 4, 2009 at 10:58 AM, Ashley Sheridan
> wrote:
>
>> On Tue, 2009-08-04 at 10:56 -0700, Jim Lucas wrote:
>>> Allen McCabe wrote:
>>>> *Parse error*: syntax error, unexpected $end in *
>>>> /home/a9066165/public_html/admin/processccu.php* on line *231*
>>>>
>>> I have learned from a number of similar mistakes that this error message
>>> /normally/ means that I have a miss-matched number of brackets on a
>>> foreach, while, or if, etc... statement.
>>>
>>> Usually the line number will represent the last line in your script. In
>>> this case, they don't seem to match...
>>>
>>> Jim
>>>
>>>> I did some major code rewriting about halfway through (lines 114-132),
>> and
>>>> suddenly I'm getting the above ERROR. I have examined the code line by
>> line,
>>>> but I'm still relatively new to this, and I don't even know what to
>> look
>>>> for!
>>>>
>>>> Here is the complete code, from beginning
>> tag:
>>>
>>>
>> Thats why I always prefer to have the brackets line up in the code (I
>> forget what the style is called) so that it looks like this:
>>
>> function someFunction
>> {
>> if(condition)
>> {
>> do something
>> }
>> }
>>
>> etc..
>>
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>>
>>
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: HELP - Parse Error

am 04.08.2009 20:50:29 von Allen McCabe

--0016364269bd4492b00470555c26
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

I created a webpage with the code listed, and a screen shot of the email I
am currently receiving (with nonsense entered into my inputs)

URL:
http://lpacmarketing.hostzi.com/admin/help.html

Anyone that can provide help will be rewarded in their next life. That's a
promise.

Thanks!

On Tue, Aug 4, 2009 at 10:58 AM, Ashley Sheridan
wrote:

> On Tue, 2009-08-04 at 10:56 -0700, Jim Lucas wrote:
> > Allen McCabe wrote:
> > > *Parse error*: syntax error, unexpected $end in *
> > > /home/a9066165/public_html/admin/processccu.php* on line *231*
> > >
> >
> > I have learned from a number of similar mistakes that this error message
> > /normally/ means that I have a miss-matched number of brackets on a
> > foreach, while, or if, etc... statement.
> >
> > Usually the line number will represent the last line in your script. In
> > this case, they don't seem to match...
> >
> > Jim
> >
> > > I did some major code rewriting about halfway through (lines 114-132),
> and
> > > suddenly I'm getting the above ERROR. I have examined the code line by
> line,
> > > but I'm still relatively new to this, and I don't even know what to
> look
> > > for!
> > >
> > > Here is the complete code, from beginning
> tag:
> > >
> >
> >
> >
> Thats why I always prefer to have the brackets line up in the code (I
> forget what the style is called) so that it looks like this:
>
> function someFunction
> {
> if(condition)
> {
> do something
> }
> }
>
> etc..
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>

--0016364269bd4492b00470555c26--

Re: HELP - Parse Error

am 04.08.2009 21:35:36 von List Manager

Allen McCabe wrote:
> I created a webpage with the code listed, and a screen shot of the email I
> am currently receiving (with nonsense entered into my inputs)
>
> URL:
> http://lpacmarketing.hostzi.com/admin/help.html
>
> Anyone that can provide help will be rewarded in their next life. That's a
> promise.

um, your hosting doesn't like that for some reason.

Click it and see what you get.

>
> Thanks!
>
> On Tue, Aug 4, 2009 at 10:58 AM, Ashley Sheridan
> wrote:
>
>> On Tue, 2009-08-04 at 10:56 -0700, Jim Lucas wrote:
>>> Allen McCabe wrote:
>>>> *Parse error*: syntax error, unexpected $end in *
>>>> /home/a9066165/public_html/admin/processccu.php* on line *231*
>>>>
>>> I have learned from a number of similar mistakes that this error message
>>> /normally/ means that I have a miss-matched number of brackets on a
>>> foreach, while, or if, etc... statement.
>>>
>>> Usually the line number will represent the last line in your script. In
>>> this case, they don't seem to match...
>>>
>>> Jim
>>>
>>>> I did some major code rewriting about halfway through (lines 114-132),
>> and
>>>> suddenly I'm getting the above ERROR. I have examined the code line by
>> line,
>>>> but I'm still relatively new to this, and I don't even know what to
>> look
>>>> for!
>>>>
>>>> Here is the complete code, from beginning
>> tag:
>>>
>>>
>> Thats why I always prefer to have the brackets line up in the code (I
>> forget what the style is called) so that it looks like this:
>>
>> function someFunction
>> {
>> if(condition)
>> {
>> do something
>> }
>> }
>>
>> etc..
>>
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>>
>>
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php